package edu.usx.server.mapper;

import edu.usx.server.pojo.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Usx
 * @since 2024-07-18
 */
@Repository
public interface CategoryMapper extends BaseMapper<Category> {

    /**
     * 根据用户id和权限查询分类
     * @param userId
     * @return
     */
    List<Category> getCategoryByUserId(int userId,Integer userRole);

    /**
     * 新增分类
     * @param category
     */

    void insertcategory(Category category);


    /**
     * 修改分类
     * @param category
     */
    void updatecategoryById(Category category);
    @Select("select * from category where name =#{name}")
    String selectByName(String name);

    /**
     *
     * 根据name查询
     * @param name
     * @return
     */


}
